function BankAccount(arg_firstName, arg_lastName, arg_inialAmount) {

    // this is a public property of all BankAcounts and can be accessed from inside and outside the class like biff.name
    this.name = arg_firstName + " " + arg_lastName;

    // this a protected value that can only be accessed from inside the class like currentBalance
    var currentBalance = arg_inialAmount;

    // this is a public property of the window because we did not use var or this.id. it is accessible from anywhere
    id = Math.floor(Math.random()*11);

    console.debug("%s account created with %n Euros", this.name,  arg_inialAmount);

    this.withdraw = function(arg_widthdrawAmount) {
        console.debug("%s withdrew %n Euros", this.name, arg_widthdrawAmount);
        currentBalance = currentBalance - arg_widthdrawAmount;
    };

    this.deposit = function(arg_depositAmount) {
        console.debug("%s deposited %n Euros",this.name,  arg_depositAmount);
        currentBalance = currentBalance + arg_depositAmount;
    };

    this.balance = function() {
        console.debug("%s balance is %n Euros",this.name,  currentBalance);
    };

}

var biffsAccount = new BankAccount("Biff", "Fratelli", 1000);
window.console.debug(id);
var josesAccount = new BankAccount("Jose", "Badeau", 1000);
console.debug(id);

biffsAccount.withdraw(500);
josesAccount.deposit(1000);

//josesAccount.currentBalance = 9999;
//console.log("jose has %n",currentBalance);


console.log(id);

biffsAccount.balance();
josesAccount.balance();



